package com.mcptt.config.body.info.mcdata.binary;

import com.cloudptt.api.comm.Common;
import com.cloudptt.api.pjsip.api.MessageInfo;
import com.cloudptt.api.product.log.Log;

public class SignalBody extends BinaryBody{
    public SignalBody()
    {

    }


    public static MessageInfo parsePayload(String hexString)
    {
        byte[] contentArr = hexStringToByteArray(hexString);//content.getBytes();
        byte type = contentArr[0];
        Log.debug(SignalBody.class,"parsePayload type =  " + type + " contentArr = " + contentArr);
        MessageInfo info = null;
        switch (type)
        {
            case SDS_SIGNALLING_PAYLOAD:
                info = SdsSignalBody.parseSignallingPayload(type,contentArr);
                break;
            case FD_SIGNALLING_PAYLOAD:
                info = FdSignalBody.parseSignalPayload(type,contentArr);
                break;
            case SDS_NOTIFYCATION:
                info = NtfSignalBody.parseSignalPayload(type,contentArr);
                break;
            case FD_NOTIFICATION:
                info = NtfSignalBody.parseSignalPayload(type,contentArr);
                break;
            default:
                break;
        }
        return info;
    }
}
